<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="test1"></div>
    <script src="./js/react.development.js"></script>
    <script src="./js/react-dom.development.js"></script>
    <script src="./js/babel.min.js"></script>
    <script src="./js/prop-types.js"></script>
    <script type="text/babel">
        function Demo(props) {
            const { name, age, sex } = props
            return (
                <ul>
                    <li>{name}</li>
                    <li>{age}</li>
                    <li>{sex}</li>
                </ul>
            )
        }

        Demo.propTypes = {
            name: PropTypes.string.isRequired,
            age: PropTypes.number.isRequired,
            sex: PropTypes.string
        }

        Demo.defaultProps = {
            sex: "不男不女"
        }
        ReactDOM.render(<Demo name="pink" age={18} />, document.getElementById('test1'))
    </script>
</body>

</html>